/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 50717
 Source Host           : localhost
 Source Database       : cmp

 Target Server Type    : MySQL
 Target Server Version : 50717
 File Encoding         : utf-8

 Date: 05/15/2017 10:08:30 AM
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `access_log`
-- ----------------------------
DROP TABLE IF EXISTS `access_log`;
CREATE TABLE `access_log` (
  `id` varchar(64) NOT NULL,
  `object` varchar(128) DEFAULT NULL COMMENT '操作对象',
  `action` varchar(128) DEFAULT NULL COMMENT '行为',
  `result` varchar(255) DEFAULT NULL COMMENT '结果',
  `user_id` bigint(20) DEFAULT NULL COMMENT '操作者id',
  `response_ip` varchar(16) DEFAULT NULL COMMENT '操作者名称',
  `request_ip` varchar(32) DEFAULT NULL COMMENT 'ip',
  `gmt_create` datetime DEFAULT NULL COMMENT '创建时间',
  `detail` text,
  `module` varchar(32) DEFAULT NULL,
  `tenant_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `alarm`
-- ----------------------------
DROP TABLE IF EXISTS `alarm`;
CREATE TABLE `alarm` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` varchar(64) NOT NULL COMMENT '机柜名称',
  `gmt_create` datetime NOT NULL COMMENT '创建时间',
  `gmt_modify` datetime DEFAULT NULL COMMENT '修改时间',
  `creater_id` bigint(20) NOT NULL COMMENT '创建者ID',
  `mender_id` bigint(20) DEFAULT NULL COMMENT '修改者ID',
  `owner_id` bigint(20) DEFAULT NULL COMMENT '所有者ID',
  `status` varchar(16) DEFAULT NULL COMMENT '状态',
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `remark` varchar(256) DEFAULT NULL COMMENT '描述',
  `level` varchar(16) DEFAULT NULL,
  `type` varchar(32) DEFAULT NULL,
  `target` varchar(64) DEFAULT NULL,
  `alarm_val` varchar(32) DEFAULT NULL,
  `gmt_trigger` datetime DEFAULT NULL,
  `gmt_confirm` datetime DEFAULT NULL,
  `confirmer` varchar(64) DEFAULT NULL,
  `vendor_id` bigint(20) DEFAULT NULL,
  `is_deleted` tinyint(1) DEFAULT NULL COMMENT '是否删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `application`
-- ----------------------------
DROP TABLE IF EXISTS `application`;
CREATE TABLE `application` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(128) NOT NULL COMMENT '应用名称',
  `status` varchar(16) NOT NULL COMMENT '状态（0 未部署，1 部署中，2 运行，3 异常）',
  `is_deleted` tinyint(1) NOT NULL COMMENT '是否删除 （0 未删除， 1 删除）',
  `remark` varchar(256) DEFAULT NULL COMMENT '描述',
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `gmt_create` datetime NOT NULL COMMENT '创建时间',
  `gmt_modify` datetime DEFAULT NULL COMMENT '修改时间',
  `creater_id` bigint(20) NOT NULL COMMENT '创建者ID',
  `mender_id` bigint(20) DEFAULT NULL COMMENT '修改者ID',
  `owner_id` bigint(20) DEFAULT NULL COMMENT '所有者ID',
  `address` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '应用访问路径',
  `tenant_id` int(11) DEFAULT NULL COMMENT '租户ID',
  `dept_id` bigint(20) DEFAULT NULL COMMENT '所属部门',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `application_layout_info`
-- ----------------------------
DROP TABLE IF EXISTS `application_layout_info`;
CREATE TABLE `application_layout_info` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `application_id` bigint(20) DEFAULT NULL,
  `layout_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `application_openshift_cluster_info`
-- ----------------------------
DROP TABLE IF EXISTS `application_openshift_cluster_info`;
CREATE TABLE `application_openshift_cluster_info` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `application_id` bigint(20) DEFAULT NULL,
  `openshift_cluster_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `application_software_info`
-- ----------------------------
DROP TABLE IF EXISTS `application_software_info`;
CREATE TABLE `application_software_info` (
  `id` bigint(11) NOT NULL AUTO_INCREMENT,
  `application_id` bigint(11) NOT NULL COMMENT '应用id',
  `software_id` bigint(11) NOT NULL COMMENT '软件id',
  `use_count` int(11) NOT NULL COMMENT '依赖总数',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `apply_record`
-- ----------------------------
DROP TABLE IF EXISTS `apply_record`;
CREATE TABLE `apply_record` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `name` varchar(64) DEFAULT NULL COMMENT '真实姓名',
  `status` varchar(16) DEFAULT NULL COMMENT '状态',
  `is_deleted` tinyint(1) NOT NULL COMMENT '是否删除',
  `remark` varchar(256) DEFAULT NULL COMMENT '描述',
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `gmt_create` datetime NOT NULL COMMENT '创建时间',
  `gmt_modify` datetime DEFAULT NULL COMMENT '修改时间',
  `creater_id` bigint(20) NOT NULL COMMENT '创建者ID',
  `mender_id` bigint(20) DEFAULT NULL COMMENT '修改者ID',
  `owner_id` bigint(20) DEFAULT NULL COMMENT '任务类型',
  `content` varchar(1024) DEFAULT NULL,
  `applicant` bigint(20) DEFAULT NULL,
  `catalog` varchar(16) DEFAULT NULL,
  `target` bigint(20) DEFAULT NULL,
  `params` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `approve_node`
-- ----------------------------
DROP TABLE IF EXISTS `approve_node`;
CREATE TABLE `approve_node` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `name` varchar(64) DEFAULT NULL COMMENT '真实姓名',
  `status` varchar(16) DEFAULT NULL COMMENT '状态',
  `is_deleted` tinyint(1) NOT NULL COMMENT '是否删除',
  `remark` varchar(256) DEFAULT NULL COMMENT '描述',
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `gmt_create` datetime NOT NULL COMMENT '创建时间',
  `gmt_modify` datetime DEFAULT NULL COMMENT '修改时间',
  `creater_id` bigint(20) NOT NULL COMMENT '创建者ID',
  `mender_id` bigint(20) DEFAULT NULL COMMENT '修改者ID',
  `owner_id` bigint(20) DEFAULT NULL COMMENT '任务类型',
  `approver` bigint(20) DEFAULT NULL,
  `apply_id` bigint(20) DEFAULT NULL,
  `applicant` bigint(20) DEFAULT NULL,
  `passed` tinyint(1) DEFAULT NULL,
  `reason` varchar(1024) DEFAULT NULL,
  `priority` int(8) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `authority`
-- ----------------------------
DROP TABLE IF EXISTS `authority`;
CREATE TABLE `authority` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` varchar(64) NOT NULL COMMENT '权限名称',
  `remark` varchar(256) DEFAULT NULL COMMENT '描述',
  `parent_id` bigint(20) DEFAULT NULL COMMENT '上级节点',
  `gmt_create` datetime NOT NULL COMMENT '创建时间',
  `gmt_modify` datetime DEFAULT NULL COMMENT '修改时间',
  `creater_id` bigint(20) NOT NULL COMMENT '创建者ID',
  `mender_id` bigint(20) DEFAULT NULL COMMENT '修改者ID',
  `status` varchar(16) DEFAULT NULL COMMENT '状态',
  `is_deleted` tinyint(1) NOT NULL COMMENT '是否删除',
  `owner_id` bigint(20) DEFAULT NULL,
  `props` varchar(1024) DEFAULT NULL COMMENT '编码',
  `action_url` varchar(64) DEFAULT NULL COMMENT '权限路径',
  `icon` varchar(64) DEFAULT NULL,
  `category` varchar(20) DEFAULT NULL,
  `priority` int(4) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=137 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `authority`
-- ----------------------------
BEGIN;
INSERT INTO `authority` VALUES ('8', '数据纵览', '数据纵览', '0', '2016-09-07 15:05:57', '2016-11-29 10:26:49', '1', '28', 'NORMAL', '0', null, '无', 'app.graph', 'glyphicon glyphicon-stats icon', 'menu', '1'), ('9', '资源管理', '资源管理', '0', '2016-09-07 20:54:08', '2016-11-23 11:26:39', '1', '28', 'NORMAL', '0', null, '无', 'app.assets', 'glyphicon glyphicon-dashboard icon', 'menu', '2'), ('10', '基础设施', '基础设施', '9', '2016-09-07 20:55:22', '2017-02-21 12:20:35', '1', '1', 'NORMAL', '0', null, '无', 'app.assets.datacenter', null, 'menu', '1'), ('13', '主机资源', '主机资源', '9', '2016-09-07 20:56:39', '2017-02-21 12:20:11', '1', '1', 'NORMAL', '0', null, '无', 'app.assets.resource', null, 'menu', '2'), ('26', '平台管理', '平台管理', '0', '2016-09-07 21:01:44', '2017-03-06 14:05:36', '1', '1', 'NORMAL', '0', null, '平台管理', 'app.config', 'glyphicon glyphicon-dashboard icon', 'menu', '3'), ('40', '系统管理', '权限管理', '0', '2016-09-08 09:59:35', '2017-03-08 17:29:37', '1', '29', 'NORMAL', '0', null, '无', 'app.userCenter', 'fa fa-desktop icon', 'menu', '7'), ('42', '用户管理', '用户管理', '40', '2016-09-08 10:00:14', '2016-10-14 17:54:45', '1', '20', 'NORMAL', '0', null, '无', 'app.userCenter.user', null, 'menu', '2'), ('43', '角色管理', '角色管理', '40', '2016-09-08 10:00:45', '2016-10-14 17:55:00', '1', '20', 'NORMAL', '0', null, '无', 'app.userCenter.role', null, 'menu', '3'), ('44', '权限管理', '权限管理', '40', '2016-09-08 10:01:03', '2016-10-14 17:55:14', '1', '20', 'NORMAL', '0', null, '无', 'app.userCenter.permission', null, 'menu', '4'), ('69', '组织机构', '组织机构', '40', '2016-10-14 17:54:28', '2016-10-14 17:54:28', '20', null, 'NORMAL', '0', null, '组织机构', 'app.userCenter.department', null, 'menu', '1'), ('94', '个人中心', '个人中心', '0', '2016-10-27 17:09:28', '2017-03-08 17:29:31', '22', '29', 'NORMAL', '0', null, '个人中心', 'app.personal', 'glyphicon glyphicon-dashboard icon', 'menu', '8'), ('104', '个人信息', '个人信息', '94', '2016-11-15 12:01:58', '2017-01-19 13:47:51', '28', '29', 'NORMAL', '0', null, '个人信息', 'app.personal.info', null, 'menu', '1'), ('109', 'Dashboard', 'DashBoard', '8', '2016-11-29 10:27:29', '2016-11-29 10:27:29', '28', null, 'NORMAL', '0', null, 'app.graph.dashboard', 'app.graph.dashboard', null, 'menu', '1'), ('115', '系统日志', '系统日志', '40', '2016-11-29 10:38:44', '2016-12-13 10:09:06', '28', '30', 'NORMAL', '0', null, '系统日志', 'app.userCenter.audit', null, 'menu', '5'), ('116', 'OpenStack', 'OpenStack管理', '26', '2017-01-20 11:41:57', '2017-03-08 17:30:19', '29', '29', 'NORMAL', '0', null, 'OpenStack管理', 'app.config.openstackTab', null, 'menu', '1'), ('117', 'VCenter', 'VMware管理', '26', '2017-01-20 11:43:01', '2017-03-06 14:35:00', '29', '28', 'NORMAL', '0', null, 'VMware管理', 'app.config.vmwareTab', null, 'menu', '2'), ('122', '镜像仓库', '镜像仓库', '0', '2017-03-01 15:21:07', '2017-03-08 09:59:56', '45', '1', 'NORMAL', '0', null, null, 'app.sortware', 'glyphicon glyphicon-stats icon', 'menu', '4'), ('123', '镜像管理', '镜像', '122', '2017-03-01 16:00:39', '2017-03-18 14:00:59', '45', '46', 'NORMAL', '0', null, null, 'app.sortware.dockerimage', null, 'menu', '2'), ('124', '仓库管理', '仓库', '122', '2017-03-01 16:01:27', '2017-03-18 14:00:48', '45', '46', 'NORMAL', '0', null, null, 'app.sortware.repository', null, 'menu', '1'), ('125', '应用服务', '应用服务', '0', '2017-03-08 10:06:57', '2017-03-08 10:06:57', '1', null, 'NORMAL', '0', null, null, 'app.adhibition', 'glyphicon glyphicon-stats icon', 'menu', '5'), ('126', '编排模板', '应用编排', '125', '2017-03-08 10:07:43', '2017-03-16 18:32:19', '1', '49', 'NORMAL', '0', null, null, 'app.adhibition.model', null, 'menu', '1'), ('127', '应用实例', '应用实例管理', '125', '2017-03-08 10:08:19', '2017-03-08 10:08:19', '1', null, 'NORMAL', '0', null, null, 'app.adhibition.apply', null, 'menu', '2'), ('128', '告警管理', '告警管理', '0', '2017-03-08 17:29:21', '2017-03-08 17:29:21', '29', null, 'NORMAL', '0', null, null, 'app.alarm', 'glyphicon glyphicon-stats icon', 'menu', '6'), ('129', '告警管理', '告警管理', '128', '2017-03-08 17:30:53', '2017-03-08 17:31:00', '29', '29', 'NORMAL', '0', null, null, 'app.alarm.manage', null, 'menu', '1'), ('132', '容器平台', '', '26', '2017-03-10 17:28:08', '2017-03-20 14:14:52', '49', '47', 'NORMAL', '0', null, null, 'app.config.kubernetes', null, 'menu', '3'), ('136', '数据报表', '数据报表', '8', '2017-03-21 11:12:02', '2017-03-21 11:12:02', '29', null, 'NORMAL', '0', null, null, 'app.graph.datareport', null, 'menu', '2');
COMMIT;

-- ----------------------------
--  Table structure for `bucket`
-- ----------------------------
DROP TABLE IF EXISTS `bucket`;
CREATE TABLE `bucket` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(64) DEFAULT NULL,
  `gmt_create` datetime NOT NULL,
  `remark` varchar(256) DEFAULT NULL,
  `space` double(8,2) DEFAULT NULL,
  `location` varchar(64) DEFAULT NULL,
  `acl` tinyint(1) DEFAULT NULL,
  `vendor_id` bigint(20) DEFAULT NULL,
  `region` bigint(20) DEFAULT NULL,
  `tenant_id` bigint(20) DEFAULT NULL,
  `gmt_modify` datetime DEFAULT NULL,
  `creater_id` bigint(20) DEFAULT NULL,
  `owner_id` bigint(20) DEFAULT NULL,
  `mender_id` bigint(20) DEFAULT NULL,
  `status` varchar(16) DEFAULT NULL,
  `is_deleted` tinyint(1) DEFAULT NULL,
  `props` varchar(1024) DEFAULT NULL,
  `expired_time` datetime DEFAULT NULL,
  `region_id` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `cloud_server`
-- ----------------------------
DROP TABLE IF EXISTS `cloud_server`;
CREATE TABLE `cloud_server` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(256) NOT NULL COMMENT '虚拟机名称',
  `status` varchar(16) DEFAULT NULL COMMENT '状态',
  `is_deleted` tinyint(1) NOT NULL COMMENT '是否删除',
  `remark` varchar(2048) DEFAULT NULL COMMENT '描述',
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `gmt_create` datetime NOT NULL COMMENT '创建时间',
  `gmt_modify` datetime DEFAULT NULL COMMENT '修改时间',
  `creater_id` bigint(20) DEFAULT NULL COMMENT '创建者ID',
  `mender_id` bigint(20) DEFAULT NULL COMMENT '修改者ID',
  `owner_id` bigint(20) DEFAULT NULL COMMENT '所有者ID',
  `account` varchar(64) DEFAULT NULL COMMENT '账号',
  `password` varchar(64) DEFAULT NULL COMMENT '密码',
  `cpu` int(8) DEFAULT NULL COMMENT 'CPU核数',
  `memory` int(8) DEFAULT NULL COMMENT '内存大小(MB)',
  `disk` int(8) DEFAULT NULL COMMENT '磁盘容量(GB)',
  `private_ips` varchar(512) DEFAULT NULL COMMENT '管理IP',
  `manager_port` int(10) DEFAULT NULL COMMENT '管理端口',
  `vendor_id` bigint(20) DEFAULT NULL COMMENT '云供应商id',
  `region` bigint(20) DEFAULT NULL COMMENT '区域',
  `image_id` varchar(64) DEFAULT NULL,
  `instance_id` varchar(64) DEFAULT NULL,
  `uuid` varchar(64) DEFAULT NULL,
  `flavor_id` varchar(64) DEFAULT NULL,
  `network_id` varchar(512) DEFAULT NULL,
  `public_ips` varchar(512) DEFAULT NULL,
  `subnet_id` varchar(64) DEFAULT NULL,
  `zone` varchar(64) DEFAULT NULL,
  `router_id` varchar(64) DEFAULT NULL,
  `security_group_id` varchar(64) DEFAULT NULL,
  `request_id` varchar(64) DEFAULT NULL,
  `manager_ip` varchar(32) DEFAULT NULL,
  `expired_time` datetime DEFAULT NULL,
  `is_template` tinyint(1) DEFAULT NULL,
  `region_id` varchar(64) DEFAULT NULL,
  `internet_charge_type` varchar(64) DEFAULT NULL,
  `internet_max_bandwidthIn` int(8) DEFAULT NULL,
  `internet_max_bandwidthOut` int(8) DEFAULT NULL,
  `instance_charge_type` varchar(64) DEFAULT NULL,
  `instance_network_type` varchar(64) DEFAULT NULL,
  `instance_type` varchar(64) DEFAULT NULL,
  `system_disk_category` varchar(64) DEFAULT NULL,
  `system_disk_size` int(8) DEFAULT NULL,
  `data_disk` varchar(1024) DEFAULT NULL,
  `host_id` bigint(20) DEFAULT NULL COMMENT '宿主机id',
  `store_id` bigint(20) DEFAULT NULL COMMENT '数据存储区id',
  `template_id` bigint(20) DEFAULT NULL COMMENT '模板id',
  `host_name` varchar(64) DEFAULT NULL,
  `tools_installed` tinyint(1) DEFAULT NULL,
  `datastores` varchar(255) DEFAULT NULL,
  `tools_running` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `cloud_vendor`
-- ----------------------------
DROP TABLE IF EXISTS `cloud_vendor`;
CREATE TABLE `cloud_vendor` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `name` varchar(64) DEFAULT NULL COMMENT '名称',
  `status` varchar(16) DEFAULT NULL COMMENT '状态',
  `is_deleted` tinyint(1) DEFAULT NULL COMMENT '是否删除',
  `remark` varchar(256) DEFAULT NULL COMMENT '描述',
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `gmt_create` datetime DEFAULT NULL COMMENT '创建时间',
  `gmt_modify` datetime DEFAULT NULL COMMENT '修改时间',
  `creater_id` bigint(20) DEFAULT NULL COMMENT '创建者id',
  `mender_id` bigint(20) DEFAULT NULL COMMENT '修改者id',
  `owner_id` bigint(20) DEFAULT NULL COMMENT '所有者id',
  `address` varchar(128) DEFAULT NULL COMMENT '网址',
  `account` varchar(64) DEFAULT NULL,
  `password` varchar(64) DEFAULT NULL,
  `tenant` varchar(64) DEFAULT NULL,
  `type` varchar(16) DEFAULT NULL,
  `uuid` varchar(64) DEFAULT NULL,
  `version` varchar(64) DEFAULT NULL,
  `access_key` varchar(128) DEFAULT NULL,
  `secret_key` varchar(128) DEFAULT NULL,
  `domain_name` varchar(64) DEFAULT NULL,
  `project_name` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `cluster`
-- ----------------------------
DROP TABLE IF EXISTS `cluster`;
CREATE TABLE `cluster` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `uuid` varchar(64) DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `cpu_total` bigint(8) DEFAULT NULL,
  `mem_total` bigint(20) DEFAULT NULL,
  `disk_total` bigint(20) DEFAULT NULL,
  `cpu_used` bigint(20) DEFAULT NULL,
  `mem_used` bigint(20) DEFAULT NULL,
  `disk_used` bigint(20) DEFAULT NULL,
  `gmt_create` datetime DEFAULT NULL,
  `gmt_modify` datetime DEFAULT NULL,
  `gmt_expired` datetime DEFAULT NULL,
  `remark` varchar(255) DEFAULT NULL,
  `vdc_id` bigint(20) DEFAULT NULL,
  `category` varchar(64) DEFAULT NULL,
  `vendor_id` bigint(20) DEFAULT NULL,
  `creater_id` bigint(20) DEFAULT NULL,
  `mender_id` bigint(20) DEFAULT NULL,
  `owner_id` bigint(20) DEFAULT NULL,
  `status` varchar(16) DEFAULT NULL,
  `is_deleted` tinyint(1) DEFAULT NULL,
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `host_num` int(11) DEFAULT NULL COMMENT '集群下物理机数量',
  `vm_num` int(11) DEFAULT NULL COMMENT '集群下虚拟机数量',
  `template_num` int(11) DEFAULT NULL COMMENT '集群下模板数量',
  `cpu_core` int(11) DEFAULT NULL COMMENT '集群下cpu核数',
  `cluster_val` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;

-- ----------------------------
--  Table structure for `data_center`
-- ----------------------------
DROP TABLE IF EXISTS `data_center`;
CREATE TABLE `data_center` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` varchar(64) NOT NULL COMMENT '机柜名称',
  `gmt_create` datetime NOT NULL COMMENT '创建时间',
  `gmt_modify` datetime DEFAULT NULL COMMENT '修改时间',
  `creater_id` bigint(20) NOT NULL COMMENT '创建者ID',
  `mender_id` bigint(20) DEFAULT NULL COMMENT '修改者ID',
  `owner_id` bigint(20) DEFAULT NULL COMMENT '所有者ID',
  `status` varchar(16) DEFAULT NULL COMMENT '状态',
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `remark` varchar(256) DEFAULT NULL COMMENT '描述',
  `address` varchar(128) DEFAULT NULL COMMENT '所在地址',
  `contact_phone` varchar(16) DEFAULT NULL COMMENT '联系电话',
  `contacter` varchar(16) DEFAULT NULL COMMENT '联系人',
  `contact_email` varchar(64) DEFAULT NULL COMMENT '联系邮箱',
  `emergency_phone` varchar(16) DEFAULT NULL COMMENT '紧急电话',
  `vendor` varchar(64) DEFAULT NULL COMMENT '承建商',
  `commission_date` date DEFAULT NULL COMMENT '投产日期',
  `total_area` varchar(16) DEFAULT NULL COMMENT '总面积',
  `is_deleted` tinyint(1) NOT NULL COMMENT '是否删除',
  `province` varchar(32) DEFAULT NULL,
  `city` varchar(32) DEFAULT NULL,
  `coordinate` varchar(32) DEFAULT NULL,
  `used` varchar(16) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `data_store`
-- ----------------------------
DROP TABLE IF EXISTS `data_store`;
CREATE TABLE `data_store` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `capacity` bigint(20) DEFAULT NULL,
  `free_space` bigint(20) DEFAULT NULL,
  `gmt_create` datetime DEFAULT NULL,
  `gmt_modify` datetime DEFAULT NULL,
  `gmt_expired` datetime DEFAULT NULL,
  `remark` varchar(255) DEFAULT NULL,
  `vdc_id` bigint(20) DEFAULT NULL,
  `vendor_id` bigint(20) DEFAULT NULL,
  `creater_id` bigint(20) DEFAULT NULL,
  `mender_id` bigint(20) DEFAULT NULL,
  `owner_id` bigint(20) DEFAULT NULL,
  `status` varchar(16) DEFAULT NULL,
  `is_deleted` tinyint(1) DEFAULT NULL,
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `type` varchar(255) DEFAULT NULL,
  `path` varchar(255) DEFAULT NULL,
  `host_num` int(11) DEFAULT NULL COMMENT '存储下宿主机数量',
  `vm_num` int(11) DEFAULT NULL COMMENT '存储下虚拟机数量',
  `template_num` int(11) DEFAULT NULL COMMENT '存储下的模板数量',
  `store_val` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;

-- ----------------------------
--  Table structure for `department`
-- ----------------------------
DROP TABLE IF EXISTS `department`;
CREATE TABLE `department` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(64) DEFAULT NULL,
  `status` varchar(16) DEFAULT NULL,
  `is_deleted` tinyint(1) DEFAULT NULL,
  `remark` varchar(256) DEFAULT NULL,
  `props` varchar(1024) DEFAULT NULL,
  `gmt_create` datetime DEFAULT NULL,
  `gmt_modify` datetime DEFAULT NULL,
  `creater_id` bigint(20) DEFAULT NULL,
  `mender_id` bigint(20) DEFAULT NULL,
  `owner_id` bigint(20) DEFAULT NULL,
  `parent_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `department`
-- ----------------------------
BEGIN;
INSERT INTO `department` VALUES ('1', '默认', 'NORMAL', '0', '默认', '默认', '2017-04-07 16:17:42', '2017-04-07 16:17:42', '1', null, null, '0');
COMMIT;

-- ----------------------------
--  Table structure for `deploy_history`
-- ----------------------------
DROP TABLE IF EXISTS `deploy_history`;
CREATE TABLE `deploy_history` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `app_id` bigint(20) NOT NULL COMMENT '应用ID',
  `resource_type` varchar(128) NOT NULL COMMENT '资源类型',
  `resource_name` varchar(128) NOT NULL COMMENT '资源名称',
  `current_version` varchar(128) NOT NULL COMMENT '当前版本（镜像名称）',
  `previous_version` varchar(128) DEFAULT NULL COMMENT '上一个版本（镜像名称）',
  `status` varchar(16) NOT NULL COMMENT '状态（0 部署失败，1 部署成功）',
  `is_deleted` tinyint(1) NOT NULL COMMENT '是否删除 （0 未删除， 1 删除）',
  `remark` varchar(256) DEFAULT NULL COMMENT '信息描述',
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `gmt_create` datetime NOT NULL COMMENT '创建时间',
  `gmt_modify` datetime DEFAULT NULL COMMENT '修改时间',
  `creater_id` bigint(20) NOT NULL COMMENT '创建者ID',
  `mender_id` bigint(20) DEFAULT NULL COMMENT '修改者ID',
  `owner_id` bigint(20) DEFAULT NULL COMMENT '所有者ID',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户ID',
  `name` varchar(128) NOT NULL COMMENT '部署历史名称',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `dictionary`
-- ----------------------------
DROP TABLE IF EXISTS `dictionary`;
CREATE TABLE `dictionary` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(64) NOT NULL,
  `value` varchar(64) NOT NULL COMMENT '最新版本',
  `pvalue` varchar(32) NOT NULL,
  PRIMARY KEY (`id`,`pvalue`)
) ENGINE=InnoDB AUTO_INCREMENT=77 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `dictionary`
-- ----------------------------
BEGIN;
INSERT INTO `dictionary` VALUES ('1', '集群类型', 'CLUSTER_CATEGORY', '0'), ('2', '调度引擎', 'SCHEDULE_ENGINE', '0'), ('3', '部署类型', 'DEVELOP_MODE', '0'), ('4', '机柜类型', 'RACK_CATEGORY', '0'), ('5', '机房类型', 'ROOM_CATEGORY', '0'), ('6', '资源池类型', 'POOL_CATEGORY', '0'), ('7', 'SWARM', 'SWARM', 'SCHEDULE_ENGINE'), ('8', 'MESOS', 'MESOS', 'SCHEDULE_ENGINE'), ('9', 'RANDOM', 'RANDOM', 'SWARM'), ('10', 'BINPACK', 'BINPACK', 'SWARM'), ('11', 'SPREAD', 'SPREAD', 'SWARM'), ('12', '自定义', 'SELF_DEF', 'SWARM'), ('13', '机柜材质', 'RACK_MATERIAL', '0'), ('14', '所属环境', 'ENVRONMENT', '0'), ('15', 'A类', 'A_ROOM', 'ROOM_CATEGORY'), ('16', 'B类', 'B_ROOM', 'ROOM_CATEGORY'), ('17', 'C类', 'C_ROOM', 'ROOM_CATEGORY'), ('18', '铝型板', 'ALUMINUM', 'RACK_MATERIAL'), ('19', '热轧钢板', 'SPHC', 'RACK_MATERIAL'), ('20', '冷轧钢板', 'SPCC', 'RACK_MATERIAL'), ('21', '标准机柜', 'STANDARD_RACK', 'RACK_CATEGORY'), ('22', '网络机柜', 'NETWORK_RACK', 'RACK_CATEGORY'), ('23', '控制台机柜', 'CONSOLE_RACK', 'RACK_CATEGORY'), ('24', '开发环境', 'DEVELOP', 'ENVRONMENT'), ('25', '测试环境', 'TEST', 'ENVRONMENT'), ('26', '生产环境', 'PRODUCTION', 'ENVRONMENT'), ('27', '预发环境', 'READY', 'ENVRONMENT'), ('28', 'UAT环境', 'UAT', 'ENVRONMENT'), ('29', '应用集群', 'APPLICTION_CLUSTER', 'CLUSTER_CATEGORY'), ('30', '仓库集群', 'REGISTY_CLUSTER', 'CLUSTER_CATEGORY'), ('31', '容器集群', 'CONTAINER_CLUSTER', 'CLUSTER_CATEGORY'), ('32', 'KUBERNETES', 'KUBERNETES', 'SCHEDULE_ENGINE'), ('33', '节点类型', 'NODE_CATEGORY', '0'), ('34', '物理机', 'PM', 'NODE_CATEGORY'), ('35', '虚拟机', 'VM', 'NODE_CATEGORY'), ('36', '资源类型', 'RESOURCE_CATEGORY', '0'), ('37', '物理机', 'PM', 'RESOURCE_CATEGORY'), ('38', '虚拟机', 'VM', 'RESOURCE_CATEGORY'), ('39', '集群', 'CLUSTER', 'RESOURCE_CATEGORY'), ('40', '容器资源池', 'DOCKER_POOL', 'POOL_CATEGORY'), ('41', 'docker镜像', 'DOCKER_IMAGE', 'WAREHOUSE_TYPE'), ('42', '软件包', 'SOFTWARE_PACKAGE', 'WAREHOUSE_TYPE'), ('43', '仓库类型', 'WAREHOUSE_TYPE', '0'), ('44', '镜像类别', 'IMAGE_CATEGORY', '0'), ('45', '容器镜像', 'DOCKER_IMAGE', 'IMAGE_CATEGORY'), ('46', '基础镜像', 'BASE_IMAGE', 'DOCKER_IMAGE'), ('47', '应用镜像', 'APPLICATION_IMAGE', 'DOCKER_IMAGE'), ('48', '软件镜像', 'SOFTWARE_IMAGE', 'IMAGE_CATEGORY'), ('49', '虚拟机镜像', 'VIRTUAL_IMAGE', 'IMAGE_CATEGORY'), ('50', '主机类型', 'HOST_CATAGORY', '0'), ('51', '物理主机', 'PHYSICAL_HOST', 'HOST_CATAGORY'), ('52', '虚拟主机', 'VIRTUAL_HOST', 'HOST_CATAGORY'), ('53', '主机状态', 'HOST_STATUS', '0'), ('54', '正常', 'NORMAL', 'HOST_STATUS'), ('55', '告警', 'ALARM', 'HOST_STATUS'), ('56', '异常', 'ABNORMAL', 'HOST_STATUS'), ('57', '不可用', 'DISABLED', 'HOST_STATUS'), ('58', '运行方式', 'WAHEHOUSE_RUN', '0'), ('59', '容器', 'CONTAINER_MODE', 'WAHEHOUSE_RUN'), ('60', '物理机', 'PHYSICAL_MODE', 'WAHEHOUSE_RUN'), ('61', '部署方式', 'WAHEHOUSE_DEPLOYMENT', '0'), ('62', '单机', 'STANDALONE_MODE', 'WAHEHOUSE_DEPLOYMENT'), ('63', '区域分类', 'REGION', '0'), ('64', '华东区A', 'HUADONGA', 'REGION'), ('65', '华东区B', 'HUADONGB', 'REGION'), ('66', '华北区A', 'HUABEIA', 'REGION'), ('67', '华北区B', 'HUABEIB', 'REGION'), ('68', '华南区A', 'HUANANA', 'REGION'), ('69', '华中区A', 'HUAZHONGA', 'REGION'), ('70', 'OS名称', 'OS_NAME', '0'), ('71', 'CentOS', 'CENTOS', 'OS_NAME'), ('72', 'Ubuntu', 'UBUNTU', 'OS_NAME'), ('73', 'ES配置项', 'LOG_INDEX', '0'), ('74', 'SERVICEURL', 'http://192.168.1.17:9200', 'LOG_INDEX'), ('75', 'INDEXBACKPATH', '/mnt/backups/backup', 'LOG_INDEX'), ('76', 'INDEXARCHPATH', '/mnt/backups/backup', 'LOG_INDEX');
COMMIT;

-- ----------------------------
--  Table structure for `flavor`
-- ----------------------------
DROP TABLE IF EXISTS `flavor`;
CREATE TABLE `flavor` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(64) DEFAULT NULL,
  `flavor_id` varchar(64) DEFAULT NULL,
  `memory` int(8) DEFAULT NULL,
  `cpu` int(8) DEFAULT NULL,
  `disk` int(8) DEFAULT NULL,
  `vendor_id` bigint(20) DEFAULT NULL,
  `family` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `host_perf`
-- ----------------------------
DROP TABLE IF EXISTS `host_perf`;
CREATE TABLE `host_perf` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `host_name` varchar(255) DEFAULT NULL,
  `cpu_util` float(11,2) DEFAULT NULL,
  `disk_util` float(11,2) DEFAULT NULL,
  `mem_util` float(11,2) DEFAULT NULL,
  `network_incoming` float(11,4) DEFAULT NULL,
  `network_outgoing` float(11,4) DEFAULT NULL,
  `vendor_id` bigint(1) DEFAULT NULL,
  `gmt_create` datetime DEFAULT NULL,
  `is_gather` int(255) DEFAULT '0' COMMENT '0 是实时数据，1 汇总数据',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `host_system`
-- ----------------------------
DROP TABLE IF EXISTS `host_system`;
CREATE TABLE `host_system` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `uuid` varchar(64) DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `cpu_total` bigint(8) DEFAULT NULL,
  `mem_total` bigint(20) DEFAULT NULL,
  `disk_total` bigint(20) DEFAULT NULL,
  `cpu_used` bigint(20) DEFAULT NULL,
  `mem_used` bigint(20) DEFAULT NULL,
  `disk_used` bigint(20) DEFAULT NULL,
  `gmt_create` datetime DEFAULT NULL,
  `gmt_modify` datetime DEFAULT NULL,
  `gmt_expired` datetime DEFAULT NULL,
  `remark` varchar(255) DEFAULT NULL,
  `vdc_id` bigint(20) DEFAULT NULL,
  `vendor_id` bigint(20) DEFAULT NULL,
  `category` varchar(255) DEFAULT NULL,
  `catalog` varchar(255) DEFAULT NULL,
  `cpu_model` varchar(255) DEFAULT NULL,
  `status` varchar(64) DEFAULT NULL,
  `cluster_id` bigint(20) DEFAULT NULL,
  `vendor` varchar(255) DEFAULT NULL,
  `creater_id` bigint(20) DEFAULT NULL,
  `mender_id` bigint(20) DEFAULT NULL,
  `owner_id` bigint(20) DEFAULT NULL,
  `is_deleted` tinyint(1) DEFAULT NULL,
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `template_num` int(11) DEFAULT NULL COMMENT '宿主机所在集群的名称',
  `vm_num` int(11) DEFAULT NULL COMMENT '宿主机（物理机）上虚拟机数量',
  `power_state` varchar(32) DEFAULT NULL COMMENT '物理机电源状态',
  `cpu_num` int(11) DEFAULT NULL COMMENT '宿主机cpu数量',
  `cpu_core` int(11) DEFAULT NULL COMMENT '宿主机cpu核数',
  `datastore_num` int(11) DEFAULT NULL COMMENT '宿主机数据存储数量',
  `host_ip` varchar(16) DEFAULT NULL COMMENT 'ip地址',
  `maintain` tinyint(1) DEFAULT NULL,
  `connected` tinyint(1) DEFAULT NULL,
  `uuid_key` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;

-- ----------------------------
--  Table structure for `image`
-- ----------------------------
DROP TABLE IF EXISTS `image`;
CREATE TABLE `image` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(128) NOT NULL COMMENT '镜像名称(centOS7.iso)',
  `status` varchar(16) DEFAULT NULL COMMENT '状态',
  `is_deleted` tinyint(1) NOT NULL COMMENT '是否删除',
  `remark` varchar(256) DEFAULT NULL COMMENT '描述',
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `gmt_create` datetime NOT NULL COMMENT '创建时间',
  `gmt_modify` datetime DEFAULT NULL COMMENT '修改时间',
  `creater_id` bigint(20) DEFAULT NULL COMMENT '创建者ID',
  `mender_id` bigint(20) DEFAULT NULL COMMENT '修改者ID',
  `owner_id` bigint(20) DEFAULT NULL COMMENT '所有者ID',
  `os_name` varchar(64) DEFAULT NULL COMMENT '镜像系统名称ID',
  `os_version` varchar(64) DEFAULT NULL COMMENT '镜像系统类型(centOS7)',
  `vendor_id` bigint(20) DEFAULT NULL COMMENT '云供应商id',
  `image_id` varchar(64) DEFAULT NULL,
  `uuid` varchar(64) DEFAULT NULL,
  `region` bigint(20) DEFAULT NULL,
  `kernel_version` varchar(64) DEFAULT NULL,
  `architecture` varchar(64) DEFAULT NULL,
  `os_type` varchar(64) DEFAULT NULL,
  `size` double(8,2) DEFAULT NULL,
  `base` varchar(64) DEFAULT NULL,
  `base_show` varchar(64) DEFAULT NULL,
  `min_disk` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `image_layout_info`
-- ----------------------------
DROP TABLE IF EXISTS `image_layout_info`;
CREATE TABLE `image_layout_info` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `image_id` bigint(20) DEFAULT NULL,
  `layout_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `layout`
-- ----------------------------
DROP TABLE IF EXISTS `layout`;
CREATE TABLE `layout` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `file_name` varchar(64) DEFAULT NULL,
  `file_path` varchar(128) DEFAULT NULL,
  `remark` varchar(200) DEFAULT NULL,
  `status` varchar(16) NOT NULL,
  `is_deleted` tinyint(1) DEFAULT NULL,
  `gmt_create` datetime DEFAULT NULL,
  `gmt_modify` datetime DEFAULT NULL,
  `creater_id` bigint(20) DEFAULT NULL,
  `mender_id` bigint(20) DEFAULT NULL,
  `owner_id` bigint(20) DEFAULT NULL,
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `type` varchar(16) NOT NULL DEFAULT 'KUBERNETES',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `message`
-- ----------------------------
DROP TABLE IF EXISTS `message`;
CREATE TABLE `message` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `name` varchar(64) DEFAULT NULL COMMENT '真实姓名',
  `status` varchar(16) DEFAULT NULL COMMENT '状态',
  `is_deleted` tinyint(1) NOT NULL COMMENT '是否删除',
  `remark` varchar(256) DEFAULT NULL COMMENT '描述',
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `gmt_create` datetime NOT NULL COMMENT '创建时间',
  `gmt_modify` datetime DEFAULT NULL COMMENT '修改时间',
  `creater_id` bigint(20) NOT NULL COMMENT '创建者ID',
  `mender_id` bigint(20) DEFAULT NULL COMMENT '修改者ID',
  `owner_id` bigint(20) DEFAULT NULL COMMENT '任务类型',
  `sender` bigint(20) DEFAULT NULL COMMENT '发送人',
  `content` text COMMENT '内容',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `network`
-- ----------------------------
DROP TABLE IF EXISTS `network`;
CREATE TABLE `network` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(256) DEFAULT NULL,
  `network_id` varchar(64) DEFAULT NULL,
  `vendor_id` bigint(20) DEFAULT NULL,
  `region` bigint(20) DEFAULT NULL,
  `type` varchar(64) DEFAULT NULL,
  `status` varchar(16) DEFAULT NULL,
  `shared` tinyint(1) DEFAULT NULL,
  `admin_stateup` tinyint(1) DEFAULT NULL,
  `expired_time` datetime DEFAULT NULL,
  `gmt_create` datetime DEFAULT NULL,
  `gmt_modify` datetime DEFAULT NULL,
  `creater_id` bigint(20) DEFAULT NULL,
  `owner_id` bigint(20) DEFAULT NULL,
  `mender_id` bigint(20) DEFAULT NULL,
  `is_deleted` tinyint(1) DEFAULT NULL,
  `props` varchar(1024) DEFAULT NULL,
  `remark` varchar(256) DEFAULT NULL,
  `network_val` varchar(64) DEFAULT NULL,
  `vdc_id` bigint(20) DEFAULT NULL,
  `is_router_external` tinyint(1) DEFAULT NULL,
  `segmentation_id` varchar(36) DEFAULT NULL,
  `phy_network` varchar(36) DEFAULT NULL,
  `port_num` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `network_card`
-- ----------------------------
DROP TABLE IF EXISTS `network_card`;
CREATE TABLE `network_card` (
  `id` bigint(10) NOT NULL AUTO_INCREMENT,
  `NAME` varchar(64) DEFAULT NULL,
  `mac` varchar(32) DEFAULT NULL COMMENT '物理网卡mac值',
  `used` tinyint(1) DEFAULT NULL COMMENT '该网卡是否被使用',
  `creater_id` bigint(20) DEFAULT NULL,
  `host_id` bigint(20) DEFAULT NULL,
  `gmt_create` datetime NOT NULL COMMENT '创建时间',
  `gmt_modify` datetime DEFAULT NULL COMMENT '修改时间',
  `mender_id` bigint(20) DEFAULT NULL COMMENT '修改者ID',
  `owner_id` bigint(20) DEFAULT NULL COMMENT '所有者ID',
  `status` varchar(16) DEFAULT NULL COMMENT '状态',
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `remark` varchar(256) DEFAULT NULL COMMENT '描述',
  `is_deleted` tinyint(1) DEFAULT NULL COMMENT '是否删除',
  `vendor_id` bigint(20) DEFAULT NULL,
  `category` varchar(16) DEFAULT NULL,
  `label` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `network_device`
-- ----------------------------
DROP TABLE IF EXISTS `network_device`;
CREATE TABLE `network_device` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `name` varchar(64) DEFAULT NULL COMMENT '真实姓名',
  `status` varchar(16) DEFAULT NULL COMMENT '状态',
  `is_deleted` tinyint(1) NOT NULL COMMENT '是否删除',
  `remark` varchar(256) DEFAULT NULL COMMENT '描述',
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `gmt_create` datetime NOT NULL COMMENT '创建时间',
  `gmt_modify` datetime DEFAULT NULL COMMENT '修改时间',
  `creater_id` bigint(20) NOT NULL COMMENT '创建者ID',
  `mender_id` bigint(20) DEFAULT NULL COMMENT '修改者ID',
  `owner_id` bigint(20) DEFAULT NULL COMMENT '任务类型',
  `version` varchar(64) DEFAULT NULL,
  `serial` varchar(64) DEFAULT NULL,
  `location` varchar(128) DEFAULT NULL,
  `device_name` varchar(64) DEFAULT NULL,
  `asset_tag` varchar(64) DEFAULT NULL,
  `befrom` varchar(128) DEFAULT NULL,
  `maker` varchar(128) DEFAULT NULL,
  `contract_no` varchar(64) DEFAULT NULL,
  `service_start` datetime DEFAULT NULL,
  `service_end` datetime DEFAULT NULL,
  `vendor` varchar(128) DEFAULT NULL,
  `vendor_phone` varchar(16) DEFAULT NULL,
  `maker_phone` varchar(16) DEFAULT NULL,
  `hardware` varchar(128) DEFAULT NULL,
  `environment` varchar(32) DEFAULT NULL,
  `service_ip` varchar(16) DEFAULT NULL,
  `service_port` varchar(16) DEFAULT NULL,
  `type` varchar(32) DEFAULT NULL,
  `account` varchar(64) DEFAULT NULL,
  `password` varchar(64) DEFAULT NULL,
  `rack_id` bigint(20) DEFAULT NULL,
  `expired_time` datetime DEFAULT NULL,
  `start_command` text,
  `stop_command` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `network_host`
-- ----------------------------
DROP TABLE IF EXISTS `network_host`;
CREATE TABLE `network_host` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `network_id` bigint(20) DEFAULT NULL COMMENT '网络ID',
  `vhost_id` bigint(20) DEFAULT NULL COMMENT '主机ID',
  `vendor_id` bigint(20) DEFAULT NULL,
  `category` varchar(16) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `openshift_cluster`
-- ----------------------------
DROP TABLE IF EXISTS `openshift_cluster`;
CREATE TABLE `openshift_cluster` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(128) NOT NULL COMMENT 'openshift集群名称',
  `status` varchar(16) DEFAULT NULL COMMENT '状态（0 正常，1 异常）',
  `is_deleted` tinyint(1) NOT NULL COMMENT '是否删除（0 未删除, 1 删除）',
  `remark` varchar(256) DEFAULT NULL COMMENT '描述',
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `gmt_create` datetime NOT NULL COMMENT '创建时间',
  `gmt_modify` datetime DEFAULT NULL COMMENT '修改时间',
  `creater_id` bigint(20) NOT NULL COMMENT '创建者ID',
  `mender_id` bigint(20) DEFAULT NULL COMMENT '修改者ID',
  `owner_id` bigint(20) DEFAULT NULL COMMENT '所有者ID',
  `proxy_url` varchar(128) NOT NULL COMMENT '代理主机ip地址',
  `token` varchar(2048) NOT NULL,
  `master_ip` varchar(32) NOT NULL,
  `username` varchar(15) NOT NULL,
  `password` varchar(64) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `openshift_cluster_security`
-- ----------------------------
DROP TABLE IF EXISTS `openshift_cluster_security`;
CREATE TABLE `openshift_cluster_security` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `openshift_cluster_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  `salt` varchar(64) DEFAULT NULL COMMENT '随机数值',
  `api_key` varchar(64) DEFAULT NULL,
  `sec_key` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `port`
-- ----------------------------
DROP TABLE IF EXISTS `port`;
CREATE TABLE `port` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(32) DEFAULT NULL,
  `status` varchar(16) DEFAULT NULL,
  `device_id` varchar(256) DEFAULT NULL,
  `device_owner` varchar(64) DEFAULT NULL,
  `ip_address` varchar(128) DEFAULT NULL,
  `subnet_id` varchar(128) DEFAULT NULL,
  `network_id` varchar(64) DEFAULT NULL,
  `mac_address` varchar(64) DEFAULT NULL,
  `port_id` varchar(64) DEFAULT NULL,
  `vendor_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `port_group`
-- ----------------------------
DROP TABLE IF EXISTS `port_group`;
CREATE TABLE `port_group` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` varchar(128) NOT NULL COMMENT '机柜名称',
  `gmt_create` datetime NOT NULL COMMENT '创建时间',
  `gmt_modify` datetime DEFAULT NULL COMMENT '修改时间',
  `creater_id` bigint(20) NOT NULL COMMENT '创建者ID',
  `mender_id` bigint(20) DEFAULT NULL COMMENT '修改者ID',
  `owner_id` bigint(20) DEFAULT NULL COMMENT '所有者ID',
  `status` varchar(16) DEFAULT NULL COMMENT '状态',
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `remark` varchar(256) DEFAULT NULL COMMENT '描述',
  `type` varchar(32) DEFAULT NULL,
  `group_val` varchar(32) DEFAULT NULL,
  `vendor_id` bigint(20) DEFAULT NULL,
  `is_deleted` tinyint(1) DEFAULT NULL COMMENT '是否删除',
  `network_id` bigint(20) DEFAULT NULL,
  `port_num` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `rack`
-- ----------------------------
DROP TABLE IF EXISTS `rack`;
CREATE TABLE `rack` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` varchar(64) NOT NULL COMMENT '机柜名称',
  `gmt_create` datetime NOT NULL COMMENT '创建时间',
  `gmt_modify` datetime DEFAULT NULL COMMENT '修改时间',
  `creater_id` bigint(20) NOT NULL COMMENT '创建者ID',
  `mender_id` bigint(20) DEFAULT NULL COMMENT '修改者ID',
  `owner_id` bigint(20) DEFAULT NULL COMMENT '所有者ID',
  `remark` varchar(256) DEFAULT NULL,
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `descs` varchar(256) DEFAULT NULL COMMENT '描述',
  `specs` varchar(64) DEFAULT NULL,
  `vendor` varchar(64) DEFAULT NULL,
  `product_date` date DEFAULT NULL COMMENT '生产日期',
  `product_sn` varchar(64) DEFAULT NULL COMMENT '出厂编号',
  `warranty` varchar(8) DEFAULT NULL COMMENT '质保期',
  `type` varchar(32) DEFAULT NULL COMMENT '类型{1:控制台机柜，2:标准机柜,3:网络机柜}',
  `slot_amount` int(8) DEFAULT NULL COMMENT '卡槽数量',
  `material` varchar(32) DEFAULT NULL COMMENT '机柜材质',
  `room_id` bigint(20) DEFAULT NULL COMMENT '机房ID',
  `is_deleted` tinyint(1) NOT NULL COMMENT '是否删除',
  `unit` int(4) DEFAULT NULL COMMENT 'U数',
  `axis_x` int(4) DEFAULT NULL COMMENT '横轴',
  `axis_y` int(4) DEFAULT NULL COMMENT '纵轴',
  `status` varchar(16) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `region`
-- ----------------------------
DROP TABLE IF EXISTS `region`;
CREATE TABLE `region` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(64) DEFAULT NULL,
  `code` varchar(64) DEFAULT NULL,
  `vendor_id` bigint(20) DEFAULT NULL,
  `region_id` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `registry`
-- ----------------------------
DROP TABLE IF EXISTS `registry`;
CREATE TABLE `registry` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(128) NOT NULL COMMENT '仓库名称',
  `status` varchar(16) DEFAULT NULL COMMENT '状态（0 正常，1 异常， 2 锁定）',
  `is_deleted` tinyint(1) NOT NULL COMMENT '是否删除（0 未删除, 1 删除）',
  `remark` varchar(256) DEFAULT NULL COMMENT '描述',
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `gmt_create` datetime NOT NULL COMMENT '创建时间',
  `gmt_modify` datetime DEFAULT NULL COMMENT '修改时间',
  `creater_id` bigint(20) NOT NULL COMMENT '创建者ID',
  `mender_id` bigint(20) DEFAULT NULL COMMENT '修改者ID',
  `owner_id` bigint(20) DEFAULT NULL COMMENT '所有者ID',
  `type` int(5) DEFAULT NULL COMMENT '仓库类型（0：镜像仓库,1 yum 源，2 代码库，3 maven库，4 其它）',
  `address` varchar(128) NOT NULL,
  `port` int(11) NOT NULL,
  `property` int(5) DEFAULT NULL COMMENT '属性： 0 共有   1 私有',
  `dept_id` bigint(20) DEFAULT NULL,
  `username` varchar(32) NOT NULL,
  `password` varchar(32) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `repository_software_info`
-- ----------------------------
DROP TABLE IF EXISTS `repository_software_info`;
CREATE TABLE `repository_software_info` (
  `id` bigint(11) NOT NULL AUTO_INCREMENT,
  `repository_id` bigint(11) NOT NULL COMMENT '仓库id',
  `namespace` varchar(100) DEFAULT NULL COMMENT '仓库命名空间',
  `software_id` bigint(11) NOT NULL COMMENT '软件id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `resource_event`
-- ----------------------------
DROP TABLE IF EXISTS `resource_event`;
CREATE TABLE `resource_event` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `vm_id` bigint(20) DEFAULT NULL,
  `content` varchar(16) DEFAULT NULL,
  `result` varchar(16) DEFAULT NULL,
  `operator_id` bigint(20) DEFAULT NULL,
  `gmt_operate` datetime DEFAULT NULL,
  `object` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `role`
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `name` varchar(64) NOT NULL COMMENT '角色名称',
  `remark` varchar(256) DEFAULT NULL COMMENT '描述',
  `gmt_create` datetime NOT NULL COMMENT '创建时间',
  `gmt_modify` datetime DEFAULT NULL COMMENT '修改时间',
  `creater_id` bigint(20) DEFAULT NULL COMMENT '创建者ID',
  `mender_id` bigint(20) DEFAULT NULL COMMENT '修改者ID',
  `status` varchar(16) DEFAULT NULL COMMENT '状态',
  `is_deleted` tinyint(1) NOT NULL COMMENT '是否删除',
  `owner_id` bigint(20) DEFAULT NULL,
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `role`
-- ----------------------------
BEGIN;
INSERT INTO `role` VALUES ('1', '超级管理员', '超级管理员', '2016-05-31 16:46:20', '2017-04-07 16:16:00', '1', '1', 'NORMAL', '0', null, '无');
COMMIT;

-- ----------------------------
--  Table structure for `role_authority`
-- ----------------------------
DROP TABLE IF EXISTS `role_authority`;
CREATE TABLE `role_authority` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `role_id` bigint(20) DEFAULT NULL COMMENT '角色ID',
  `auth_id` bigint(20) DEFAULT NULL COMMENT '权限ID',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4834 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `role_authority`
-- ----------------------------
BEGIN;
INSERT INTO `role_authority` VALUES ('4806', '1', '8'), ('4807', '1', '9'), ('4808', '1', '26'), ('4809', '1', '122'), ('4810', '1', '125'), ('4811', '1', '128'), ('4812', '1', '40'), ('4813', '1', '94'), ('4814', '1', '109'), ('4815', '1', '136'), ('4816', '1', '10'), ('4817', '1', '13'), ('4818', '1', '119'), ('4819', '1', '120'), ('4820', '1', '116'), ('4821', '1', '117'), ('4822', '1', '132'), ('4823', '1', '123'), ('4824', '1', '124'), ('4825', '1', '126'), ('4826', '1', '127'), ('4827', '1', '129'), ('4828', '1', '42'), ('4829', '1', '43'), ('4830', '1', '44'), ('4831', '1', '69'), ('4832', '1', '115'), ('4833', '1', '104');
COMMIT;

-- ----------------------------
--  Table structure for `room`
-- ----------------------------
DROP TABLE IF EXISTS `room`;
CREATE TABLE `room` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` varchar(64) NOT NULL COMMENT '机柜名称',
  `gmt_create` datetime NOT NULL COMMENT '创建时间',
  `gmt_modify` datetime DEFAULT NULL COMMENT '修改时间',
  `creater_id` bigint(20) NOT NULL COMMENT '创建者ID',
  `mender_id` bigint(20) DEFAULT NULL COMMENT '修改者ID',
  `owner_id` bigint(20) DEFAULT NULL COMMENT '所有者ID',
  `status` varchar(16) DEFAULT NULL COMMENT '状态',
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `remark` varchar(256) DEFAULT NULL COMMENT '描述',
  `location_sn` varchar(64) DEFAULT '' COMMENT '位置编号{楼号-楼层-房间号}',
  `contact_phone` varchar(16) DEFAULT NULL COMMENT '联系电话',
  `contacter` varchar(16) DEFAULT NULL COMMENT '联系人',
  `type` varchar(32) DEFAULT NULL COMMENT '机房类型',
  `commission_date` date DEFAULT NULL COMMENT '投产日期',
  `total_area` varchar(16) DEFAULT NULL COMMENT '总面积',
  `dc_id` bigint(20) DEFAULT NULL COMMENT '数据中心ID',
  `is_deleted` tinyint(1) NOT NULL COMMENT '是否删除',
  `row_num` int(4) DEFAULT NULL,
  `col_num` int(4) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `route`
-- ----------------------------
DROP TABLE IF EXISTS `route`;
CREATE TABLE `route` (
  `id` bigint(8) NOT NULL AUTO_INCREMENT,
  `route_id` varchar(36) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `status` varchar(16) DEFAULT NULL,
  `admin_stateup` tinyint(1) DEFAULT NULL,
  `network_id` varchar(36) DEFAULT NULL,
  `enable_snat` tinyint(1) DEFAULT NULL,
  `ha` tinyint(1) DEFAULT NULL,
  `availability_zones` varchar(16) DEFAULT NULL,
  `project_id` varchar(36) DEFAULT NULL,
  `tenant_id` varchar(36) DEFAULT NULL,
  `vendor_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `safety_device`
-- ----------------------------
DROP TABLE IF EXISTS `safety_device`;
CREATE TABLE `safety_device` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `name` varchar(64) DEFAULT NULL COMMENT '真实姓名',
  `status` varchar(16) DEFAULT NULL COMMENT '状态',
  `is_deleted` tinyint(1) NOT NULL COMMENT '是否删除',
  `remark` varchar(256) DEFAULT NULL COMMENT '描述',
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `gmt_create` datetime NOT NULL COMMENT '创建时间',
  `gmt_modify` datetime DEFAULT NULL COMMENT '修改时间',
  `creater_id` bigint(20) NOT NULL COMMENT '创建者ID',
  `mender_id` bigint(20) DEFAULT NULL COMMENT '修改者ID',
  `owner_id` bigint(20) DEFAULT NULL COMMENT '任务类型',
  `version` varchar(64) DEFAULT NULL,
  `serial` varchar(64) DEFAULT NULL,
  `location` varchar(128) DEFAULT NULL,
  `device_name` varchar(64) DEFAULT NULL,
  `asset_tag` varchar(64) DEFAULT NULL,
  `befrom` varchar(128) DEFAULT NULL,
  `maker` varchar(128) DEFAULT NULL,
  `contract_no` varchar(64) DEFAULT NULL,
  `service_start` datetime DEFAULT NULL,
  `service_end` datetime DEFAULT NULL,
  `vendor` varchar(128) DEFAULT NULL,
  `vendor_phone` varchar(16) DEFAULT NULL,
  `maker_phone` varchar(16) DEFAULT NULL,
  `hardware` varchar(128) DEFAULT NULL,
  `environment` varchar(32) DEFAULT NULL,
  `service_ip` varchar(16) DEFAULT NULL,
  `service_port` varchar(16) DEFAULT NULL,
  `type` varchar(32) DEFAULT NULL,
  `account` varchar(64) DEFAULT NULL,
  `password` varchar(64) DEFAULT NULL,
  `rack_id` bigint(20) DEFAULT NULL,
  `expired_time` datetime DEFAULT NULL,
  `start_command` text,
  `stop_command` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `security_group`
-- ----------------------------
DROP TABLE IF EXISTS `security_group`;
CREATE TABLE `security_group` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `gmt_create` datetime DEFAULT NULL,
  `remark` varchar(256) DEFAULT NULL,
  `uuid` varchar(64) DEFAULT NULL,
  `tenant_id` bigint(20) DEFAULT NULL,
  `request_id` varchar(64) DEFAULT NULL,
  `vendor_id` bigint(20) DEFAULT NULL,
  `region` bigint(20) DEFAULT NULL,
  `name` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `server`
-- ----------------------------
DROP TABLE IF EXISTS `server`;
CREATE TABLE `server` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(64) NOT NULL COMMENT '主机名称',
  `gmt_create` datetime NOT NULL COMMENT '创建时间',
  `gmt_modify` datetime DEFAULT NULL COMMENT '修改时间',
  `creater_id` bigint(20) NOT NULL COMMENT '创建者ID',
  `mender_id` bigint(20) DEFAULT NULL COMMENT '修改者ID',
  `owner_id` bigint(20) DEFAULT NULL COMMENT '所有者ID',
  `status` varchar(16) DEFAULT NULL COMMENT '状态',
  `props` varchar(255) DEFAULT NULL COMMENT '其他属性',
  `remark` varchar(255) DEFAULT NULL COMMENT '描述',
  `uuid` varchar(64) DEFAULT NULL COMMENT 'UUID',
  `os_account` varchar(64) DEFAULT NULL COMMENT '用户账号',
  `os_password` varchar(64) DEFAULT NULL COMMENT '用户密码',
  `ipmi_account` varchar(64) DEFAULT NULL COMMENT 'IMPI账号',
  `ipmi_password` varchar(64) DEFAULT NULL COMMENT 'IMPI密码',
  `ipmi_address` varchar(16) DEFAULT NULL COMMENT 'IMPI端口',
  `ipmi_port` int(5) DEFAULT NULL,
  `processor_vendor` varchar(128) DEFAULT NULL COMMENT '处理器供应商',
  `processor_amount` int(10) DEFAULT NULL COMMENT '处理器数量',
  `processor_mode` varchar(64) DEFAULT NULL COMMENT '处理器型号',
  `memory_mode` varchar(64) DEFAULT NULL COMMENT '内存型号',
  `memory_capacity` int(10) DEFAULT NULL COMMENT '内存大小',
  `os_name` varchar(64) DEFAULT NULL COMMENT 'OS',
  `os_version` varchar(32) DEFAULT NULL COMMENT 'OS版本',
  `kernel_version` varchar(64) DEFAULT NULL COMMENT '内核版本',
  `disk_capacity` int(10) DEFAULT NULL COMMENT '磁盘容量',
  `virtualized` tinyint(1) DEFAULT NULL COMMENT '是否支持虚拟化',
  `vt_mode` varchar(16) DEFAULT NULL COMMENT '虚拟化类型{Hypervisor|KVM}',
  `support_docker` tinyint(1) DEFAULT NULL COMMENT '是否支持Docker',
  `docker_version` varchar(16) DEFAULT NULL COMMENT 'Docker 版本',
  `manager_ip` varchar(16) DEFAULT NULL COMMENT '管理IP',
  `manager_port` int(5) DEFAULT NULL COMMENT '管理端口',
  `tags` varchar(64) DEFAULT NULL COMMENT '标签',
  `rack_id` bigint(20) DEFAULT NULL COMMENT '机柜id',
  `is_deleted` tinyint(1) NOT NULL COMMENT '是否删除',
  `agent_port` int(5) DEFAULT NULL COMMENT 'agent端口',
  `bios_version` varchar(64) DEFAULT NULL COMMENT 'BIOS版本',
  `bios_vendor` varchar(64) DEFAULT NULL,
  `bios_date` date DEFAULT NULL COMMENT 'BIOS发布日期',
  `units` int(4) DEFAULT NULL COMMENT 'U数',
  `conditions` varchar(16) DEFAULT NULL COMMENT '运行状态',
  `slot_start` int(4) DEFAULT NULL COMMENT '卡槽起始点',
  `slot_num` int(4) DEFAULT NULL COMMENT '卡槽数量',
  `platform` varchar(64) DEFAULT NULL,
  `contract_no` varchar(64) DEFAULT NULL,
  `service_start` datetime DEFAULT NULL,
  `service_end` datetime DEFAULT NULL,
  `vendor` varchar(128) DEFAULT NULL,
  `vendor_phone` varchar(16) DEFAULT NULL,
  `maker_phone` varchar(16) DEFAULT NULL,
  `hardware` varchar(128) DEFAULT NULL,
  `environment` varchar(32) DEFAULT NULL,
  `service_ip` varchar(16) DEFAULT NULL,
  `service_port` varchar(16) DEFAULT NULL,
  `type` varchar(32) DEFAULT NULL,
  `capacity` int(10) DEFAULT NULL,
  `file_system` varchar(64) DEFAULT NULL,
  `username` varchar(64) DEFAULT NULL,
  `password` varchar(64) DEFAULT NULL,
  `server_id` bigint(20) DEFAULT NULL,
  `spare_capacity` int(10) DEFAULT NULL,
  `tenant_id` bigint(20) DEFAULT NULL,
  `is_allot` tinyint(1) DEFAULT NULL,
  `version` varchar(64) DEFAULT NULL,
  `serial` varchar(64) DEFAULT NULL,
  `location` varchar(128) DEFAULT NULL,
  `device_name` varchar(64) DEFAULT NULL,
  `asset_tag` varchar(64) DEFAULT NULL,
  `befrom` varchar(128) DEFAULT NULL,
  `maker` varchar(128) DEFAULT NULL,
  `mac` varchar(64) DEFAULT NULL,
  `category` varchar(64) DEFAULT NULL,
  `cpu_hz` varchar(64) DEFAULT NULL,
  `key_store` varchar(256) DEFAULT NULL,
  `expired_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `server_ip`
-- ----------------------------
DROP TABLE IF EXISTS `server_ip`;
CREATE TABLE `server_ip` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增长ID',
  `mac` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'mac地址',
  `address` varchar(64) DEFAULT NULL COMMENT 'IP地址',
  `version` varchar(20) DEFAULT NULL COMMENT '4|6',
  `type` varchar(8) DEFAULT NULL COMMENT '类型',
  `uuid` varchar(64) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `snapshot`
-- ----------------------------
DROP TABLE IF EXISTS `snapshot`;
CREATE TABLE `snapshot` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(64) DEFAULT NULL,
  `status` varchar(16) DEFAULT NULL,
  `is_deleted` tinyint(1) DEFAULT NULL,
  `remark` varchar(256) DEFAULT NULL,
  `props` varchar(1024) DEFAULT NULL,
  `gmt_create` datetime NOT NULL,
  `gmt_modify` datetime DEFAULT NULL,
  `creater_id` bigint(20) NOT NULL,
  `mender_id` bigint(20) DEFAULT NULL,
  `owner_id` bigint(20) DEFAULT NULL,
  `snapshot_id` varchar(64) DEFAULT NULL,
  `volume_id` varchar(64) DEFAULT NULL,
  `size` int(4) DEFAULT NULL,
  `vendor_id` bigint(20) DEFAULT NULL,
  `region` bigint(20) DEFAULT NULL,
  `rollback_status` varchar(64) DEFAULT NULL,
  `progress` varchar(64) DEFAULT NULL,
  `vm_id` bigint(20) DEFAULT NULL COMMENT '虚拟机ID',
  `create_time` datetime DEFAULT NULL COMMENT '快照创建时间',
  `snapshot_val` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `software`
-- ----------------------------
DROP TABLE IF EXISTS `software`;
CREATE TABLE `software` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '软件id',
  `name` varchar(128) NOT NULL COMMENT '软件名称',
  `version` varchar(128) NOT NULL COMMENT '软件版本号',
  `property` int(1) NOT NULL COMMENT '软件属性（0 公有，1 私有）',
  `type` int(1) NOT NULL COMMENT '软件类型（0 容器镜像 1 虚拟机镜像 2 rpm安装包 3 应用程序包 4 其他）',
  `status` varchar(16) DEFAULT NULL COMMENT '软件状态（0 正常，1异常， 2 锁定）',
  `is_deleted` tinyint(1) NOT NULL COMMENT '是否被删除的标记（0代表未删除，1代表删除）',
  `usage_count` int(11) NOT NULL COMMENT '使用次数',
  `remark` varchar(256) DEFAULT NULL COMMENT '描述',
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `dept_id` bigint(11) DEFAULT NULL,
  `gmt_create` datetime NOT NULL COMMENT '创建时间',
  `gmt_modify` datetime DEFAULT NULL COMMENT '修改时间',
  `creater_id` bigint(20) DEFAULT NULL COMMENT '创建者ID',
  `mender_id` bigint(20) DEFAULT NULL COMMENT '修改者ID',
  `uuid` varchar(64) DEFAULT NULL,
  `owner_id` bigint(20) DEFAULT NULL COMMENT '所有者ID',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `storage_device`
-- ----------------------------
DROP TABLE IF EXISTS `storage_device`;
CREATE TABLE `storage_device` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `name` varchar(64) DEFAULT NULL COMMENT '真实姓名',
  `status` varchar(16) DEFAULT NULL COMMENT '状态',
  `is_deleted` tinyint(1) NOT NULL COMMENT '是否删除',
  `remark` varchar(256) DEFAULT NULL COMMENT '描述',
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `gmt_create` datetime NOT NULL COMMENT '创建时间',
  `gmt_modify` datetime DEFAULT NULL COMMENT '修改时间',
  `creater_id` bigint(20) NOT NULL COMMENT '创建者ID',
  `mender_id` bigint(20) DEFAULT NULL COMMENT '修改者ID',
  `owner_id` bigint(20) DEFAULT NULL COMMENT '任务类型',
  `version` varchar(64) DEFAULT NULL,
  `serial` varchar(64) DEFAULT NULL,
  `location` varchar(128) DEFAULT NULL,
  `device_name` varchar(64) DEFAULT NULL,
  `asset_tag` varchar(64) DEFAULT NULL,
  `befrom` varchar(128) DEFAULT NULL,
  `maker` varchar(128) DEFAULT NULL,
  `contract_no` varchar(64) DEFAULT NULL,
  `service_start` datetime DEFAULT NULL,
  `service_end` datetime DEFAULT NULL,
  `vendor` varchar(128) DEFAULT NULL,
  `vendor_phone` varchar(16) DEFAULT NULL,
  `maker_phone` varchar(16) DEFAULT NULL,
  `hardware` varchar(128) DEFAULT NULL,
  `environment` varchar(32) DEFAULT NULL,
  `service_ip` varchar(16) DEFAULT NULL,
  `service_port` varchar(16) DEFAULT NULL,
  `type` varchar(32) DEFAULT NULL,
  `capacity` int(10) DEFAULT NULL,
  `file_system` varchar(64) DEFAULT NULL,
  `username` varchar(64) DEFAULT NULL,
  `password` varchar(64) DEFAULT NULL,
  `manage_ip` varchar(16) DEFAULT NULL,
  `physical_ip` varchar(16) DEFAULT NULL,
  `spare_capacity` int(10) DEFAULT NULL,
  `rack_id` bigint(20) DEFAULT NULL,
  `expired_time` datetime DEFAULT NULL,
  `start_command` text,
  `stop_command` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `store_host`
-- ----------------------------
DROP TABLE IF EXISTS `store_host`;
CREATE TABLE `store_host` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `vhost_id` bigint(20) NOT NULL,
  `store_id` bigint(20) NOT NULL,
  `vendor_id` bigint(20) DEFAULT NULL,
  `category` varchar(16) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `subnet`
-- ----------------------------
DROP TABLE IF EXISTS `subnet`;
CREATE TABLE `subnet` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(64) DEFAULT NULL,
  `start` varchar(1024) DEFAULT NULL,
  `end` varchar(1024) DEFAULT NULL,
  `cidr` varchar(64) DEFAULT NULL,
  `dhcp_enabled` tinyint(1) DEFAULT NULL,
  `gateway` varchar(16) DEFAULT NULL,
  `dns_names` varchar(1024) DEFAULT NULL,
  `host_routes` varchar(1024) DEFAULT NULL,
  `subnet_id` varchar(64) DEFAULT NULL,
  `ip_version` varchar(64) DEFAULT NULL,
  `network_id` varchar(64) DEFAULT NULL,
  `vendor_id` bigint(20) DEFAULT NULL,
  `router_id` varchar(64) DEFAULT NULL,
  `region` bigint(20) DEFAULT NULL,
  `portgroup` varchar(64) DEFAULT NULL,
  `mac` varchar(64) DEFAULT NULL,
  `address` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `user`
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `name` varchar(64) DEFAULT NULL COMMENT '真实姓名',
  `password` varchar(64) DEFAULT NULL COMMENT '密码',
  `remark` varchar(256) DEFAULT NULL COMMENT '描述',
  `email` varchar(64) DEFAULT NULL COMMENT 'Email',
  `phone` varchar(16) DEFAULT NULL COMMENT '电话',
  `mobile` varchar(16) DEFAULT NULL COMMENT '移动电话',
  `gmt_create` datetime NOT NULL COMMENT '创建时间',
  `gmt_modify` datetime DEFAULT NULL COMMENT '修改时间',
  `creater_id` bigint(20) NOT NULL COMMENT '创建者ID',
  `mender_id` bigint(20) DEFAULT NULL COMMENT '修改者ID',
  `status` varchar(16) DEFAULT NULL COMMENT '状态',
  `is_deleted` tinyint(1) NOT NULL COMMENT '是否删除',
  `owner_id` bigint(20) DEFAULT NULL,
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `username` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `company` varchar(256) DEFAULT NULL,
  `session_id` varchar(36) DEFAULT NULL,
  `login_status` tinyint(1) DEFAULT NULL,
  `depart_id` bigint(20) DEFAULT NULL,
  `user_id` varchar(16) DEFAULT NULL,
  `sex` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `user`
-- ----------------------------
BEGIN;
INSERT INTO `user` VALUES ('1', '超级管理员', '-2cc3fe75eb672eeb60a6a80aa0565466506d9d1e', '超级管理员', 'xxx@beyondcent.com', '010-1313131', '18330033981', '2016-03-23 17:48:53', '2017-05-09 21:58:56', '1', '1', 'NORMAL', '0', null, null, 'admin', '', 'CCA2BBF6F538732FFBF7E47DF018B475', '1', '1', '001', '1');
COMMIT;

-- ----------------------------
--  Table structure for `user_role`
-- ----------------------------
DROP TABLE IF EXISTS `user_role`;
CREATE TABLE `user_role` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
  `role_id` bigint(20) DEFAULT NULL COMMENT '角色ID',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `user_role`
-- ----------------------------
BEGIN;
INSERT INTO `user_role` VALUES ('1', '1', '1');
COMMIT;

-- ----------------------------
--  Table structure for `user_security`
-- ----------------------------
DROP TABLE IF EXISTS `user_security`;
CREATE TABLE `user_security` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  `salt` varchar(64) DEFAULT NULL COMMENT '随机数值',
  `api_key` varchar(64) DEFAULT NULL,
  `sec_key` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `user_security`
-- ----------------------------
BEGIN;
INSERT INTO `user_security` VALUES ('1', '1', '5560a540-3e29-48c4-b36e-8d85aa8578cb', '1214546782', '1243538932');
COMMIT;

-- ----------------------------
--  Table structure for `vdc`
-- ----------------------------
DROP TABLE IF EXISTS `vdc`;
CREATE TABLE `vdc` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `uuid` varchar(64) DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `cpu_total` bigint(8) DEFAULT NULL,
  `mem_total` bigint(20) DEFAULT NULL,
  `disk_total` bigint(20) DEFAULT NULL,
  `cpu_used` bigint(20) DEFAULT NULL,
  `mem_used` bigint(20) DEFAULT NULL,
  `disk_used` bigint(20) DEFAULT NULL,
  `gmt_create` datetime DEFAULT NULL,
  `gmt_modify` datetime DEFAULT NULL,
  `gmt_expired` datetime DEFAULT NULL,
  `remark` varchar(255) DEFAULT NULL,
  `vendor_id` bigint(20) DEFAULT NULL,
  `creater_id` bigint(20) DEFAULT NULL,
  `mender_id` bigint(20) DEFAULT NULL,
  `owner_id` bigint(20) DEFAULT NULL,
  `status` varchar(16) DEFAULT NULL,
  `is_deleted` tinyint(1) DEFAULT NULL,
  `props` varchar(1024) DEFAULT NULL COMMENT '其他属性',
  `vdc_val` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `volume`
-- ----------------------------
DROP TABLE IF EXISTS `volume`;
CREATE TABLE `volume` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(64) DEFAULT NULL,
  `status` varchar(16) DEFAULT NULL,
  `is_deleted` tinyint(1) DEFAULT NULL,
  `remark` varchar(256) DEFAULT NULL,
  `props` varchar(1024) DEFAULT NULL,
  `gmt_create` datetime NOT NULL,
  `gmt_modify` datetime DEFAULT NULL,
  `creater_id` bigint(20) NOT NULL,
  `mender_id` bigint(20) DEFAULT NULL,
  `owner_id` bigint(20) DEFAULT NULL,
  `volume_id` varchar(64) DEFAULT NULL,
  `uuid` varchar(64) DEFAULT NULL,
  `size` int(8) DEFAULT NULL,
  `vendor_id` bigint(20) DEFAULT NULL,
  `region` bigint(20) DEFAULT NULL,
  `type` varchar(64) DEFAULT NULL,
  `attached_time` datetime DEFAULT NULL,
  `category` varchar(64) DEFAULT NULL,
  `delete_auto_snapshot` tinyint(1) DEFAULT NULL,
  `delete_with_instance` tinyint(1) DEFAULT NULL,
  `enable_auto_snapshot` tinyint(1) DEFAULT NULL,
  `detached_time` datetime DEFAULT NULL,
  `image_id` varchar(64) DEFAULT NULL,
  `zone` varchar(64) DEFAULT NULL,
  `source_snapshot_id` varchar(64) DEFAULT NULL,
  `request_id` varchar(64) DEFAULT NULL,
  `boot_volume` tinyint(1) DEFAULT NULL,
  `instance_id` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `zone`
-- ----------------------------
DROP TABLE IF EXISTS `zone`;
CREATE TABLE `zone` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(64) DEFAULT NULL,
  `zone_id` varchar(64) DEFAULT NULL,
  `vendor_id` bigint(20) DEFAULT NULL,
  `region_id` varchar(64) DEFAULT NULL,
  `disk_category` varchar(128) DEFAULT NULL,
  `resources` longtext,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  View structure for `view_repository_software`
-- ----------------------------
DROP VIEW IF EXISTS `view_repository_software`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `view_repository_software` AS select `software`.`dept_id` AS `tenant_id` from `software`;

SET FOREIGN_KEY_CHECKS = 1;
